<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ztree.jsp"%>
<script type="text/javascript">
	function getRightMenus(rightId){
		$('#menuidsModal').modal('show');
		$.ajax({
			type : "GET",
			dataType : "html",
			cache : false,
			url : _ctx + "/pub/sysmgr/authmgr/get_right_menu.do?rightId="+rightId,
			success : function(content) {
				$('#menuSelect').html(content);
			},
			error : function() {
				ui.msg('信息加载错误', 0);
			}
		});
	}
	$(document).ready(function() {
		$("#div1").css({
			"left" : $("#tab1").width() + 60,
			"position" : "absolute",
			"width" : "350px",
			"float" : "right"
		});
	});
</script>
</head>
<body>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%-- <%@ include file="/WEB-INF/view/common/topbar.jsp"%> --%>
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb" style="margin-left: 4px;">
						<li><i class="icon-home home-icon"></i>首页</li>
						<li>通用模块</li>
						<li class="active">角色管理</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="widget-box">
						<div class="widget-header header-color-white">
							<div class="widget-toolbar no-border">
								<a class="btn btn-primary btn-xs"
									href="javascript:history.go(-1)"><i
									class="icon-arrow-left bigger-110"></i> 返回&nbsp;&nbsp;</a> <a
									href="#" data-action="collapse"> <i class="icon-chevron-up"></i>
								</a>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-5">
							<div class="widget-box"  style="border-bottom:1px solid #FFFFFF;">
								<div class="profile-user-info profile-user-info-striped">
									<div class="profile-info-row">
										<div class="profile-info-name">角色编码</div>
										<div class="profile-info-value">
											<span class="editable">${role.roleCode}&nbsp;</span>
										</div>
									</div>
									<div class="profile-info-row">
										<div class="profile-info-name">角色名称</div>
										<div class="profile-info-value">
											<span class="editable">${role.roleName}&nbsp;</span>
										</div>
									</div>
									<div class="profile-info-row">
										<div class="profile-info-name">角色类型</div>
										<div class="profile-info-value">
											<span class="editable">${cm:ctname('authusertype',role.roleType)}&nbsp;</span>
										</div>
									</div>
									<c:if test="${isSlUams eq true}">
									<div class="profile-info-row">
										<div class="profile-info-name">所属机构</div>
										<div class="profile-info-value">
											<span class="editable">${role.orgCode}&nbsp;</span>
										</div>
									</div>
									</c:if>
									<div class="profile-info-row">
										<div class="profile-info-name">状态</div>
										<div class="profile-info-value">
											<span class="editable">${cm:ctname('entity_status',role.roleStatus)}&nbsp;</span>
										</div>
									</div>
									<div class="profile-info-row">
										<div class="profile-info-name">公有角色</div>
										<div class="profile-info-value">
											<span class="editable">
												${cm:yesNoStr(role.isDefault)}&nbsp;</span>
										</div>
									</div>
									<div class="profile-info-row">
										<div class="profile-info-name">描述</div>
										<div class="profile-info-value">
											<span class="editable">${role.remark}&nbsp;</span>
										</div>
									</div>
									<div class="profile-info-row">
										<div class="profile-info-name">拥有此角色的用户</div>
										<div class="profile-info-value">
											<span class="editable">${role.users}&nbsp;</span>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="col-xs-7">
							<div class="widget-box">
								<div class="widget-header widget-header-flat">
									<h5 class="smaller lighter">拥有的权限</h5>
								</div>
								<div class="widget-body">
									<div class="widget-main">
										<div class="row mg-top12"
											style="overflow:auto; height: 400px; border-top:1px solid #CCCCCC;">
											<table id="sample-table-1"
										class="table table-striped table-bordered table-hover">
										<thead>
											<tr>
												<th>权限名称</th>
												<th>权限类型</th>
												<th>状态</th>
												<th>创建时间</th>
												<th>描述</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach var="r" items="${rights}">
												<tr>
													<td>${r.rightName}&nbsp;</td>
													<td>${cm:ctname('authusertype',r.type)}&nbsp;</td>
													<td>${cm:ctname('entity_status',r.status)}&nbsp;</td>
													<td><fmt:formatDate value="${r.modified}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
													<td>${r.remark}&nbsp;</td>
													<td align="center" >
													<a class="blue" href="javascript:void(0);" onclick="javascript:getRightMenus('${r.id}');" title="查看权限资源">
														 	<i class="icon-zoom-in bigger-130"></i>  
													 </a>
													</td>
												</tr>
											</c:forEach>
										</tbody>
									</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="menuidsModal" class="modal fade" role="dialog" tabindex="-1" aria-labelledby="查看" aria-hidden="false">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class='widget-header widget-header-small'><h5 class='smaller'> 权限资源</h5></div>
						<div id="menuSelect">
							<p class="text-center" style="font-size: 25px; color: #428bca;">
								<span class="icon icon-cog icon-spin"></span>
							</p>
							<p class="text-center" style="font-size: 12px; color: #428bca; margin-top: -10px; margin-bottom: 0px;">
								<span>资源信息加载中...</span>
							</p>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
